#include<cstdio>
#include<iostream>
#include<cerrno>
#include<cstring>
#include<sys/types.h>
#include<sys/wait.h>
#include<fcntl.h>

int main()
{
    //stdout
    printf("fd:1,hello printf!\n");
    fprintf(stdout,"fd:1,hello fprintf\n");
    fputs("fd:1,hello fputs\n",stdout);

    //stderr
    fprintf(stderr,"fd:2,hello fprintf!\n");
    fputs("fd:2,hello fputs\n",stderr);
    perror("fd:2,hello perror!\n");

    std::cout<<"fd=1,hello cout"<<std::endl;


    std::cerr<<"fd=2,hello,cerr"<<std::endl;
    return 0;
}
